<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2022/2/11
 * Time: 10:43
 */

namespace app\controller;


use app\validate\Users;
use Cassandra\Exception\ValidationException;
use think\exception\ValidateException;
use think\facade\Validate;

class Verify
{
    public  function index(){
        try{
            Validate(Users::class)->batch(true)->scene('test')->check([
                'name'      =>      'aaaa'
            ]);
        }catch (ValidateException $e){
            dump($e->getError());
        }
    }

    public function single(){
        dump(Validate::isEmail('aa@163.com'));
        dump(Validate::must('aa@163.com'));
        dump(Validate::checkRule(11,'number|between:1,10'));
    }
}